package com.tedu.response.common.handler;

import com.tedu.response.common.pojo.ResponseResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * <p>
 *
 * </p>
 *
 * @author Song
 * @since 2020/10/10
 */
@RestControllerAdvice
@Slf4j
public class GlobalExceptionHandler {

    @ExceptionHandler(ArithmeticException.class)
    public ResponseResult doHandler(ArithmeticException e){
        log.error(e.getMessage());
        return new ResponseResult(-1,e.getMessage(),null);
    }
}
